<template>
    <div>
        <!-- 顶部导航栏 -->
        <div class="memberTop">
            <div class="memberContainer">
                <span class="iconfont icon-zuojiantou" @click="$router.go(-1)"></span>
                <p>VIP会员</p>
            </div>
        </div>
        <!-- 信息 -->
        <div class="memberInfo">
            <div class="memberContainer">
                <div class="MI_Img">
                    <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fku.90sjimg.com%2Fback_pic%2F03%2F62%2F09%2F3357a990bc3c35c.jpg&refer=http%3A%2F%2Fku.90sjimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1643888085&t=7ec7728aa04ff3bb19ddb9d2560dfe8e" alt="">
                </div>
                <div class="MI_Text">
                    <h2 v-show="!VIPshow">暂未开通VIP会员</h2>
                    <h2 v-show="VIPshow" class="text_activated">尊敬的七猫VIP会员</h2>
                    <div class="MITname">
                        <div class="MIT_Img">
                            <img src="https://img0.baidu.com/it/u=4174622592,2828273755&fm=253&fmt=auto&app=120&f=JPEG?w=192&h=192" alt="">
                        </div>
                        <p v-show="!VIPshow">我自己</p>
                        <p v-show="VIPshow" class="name_activated">我自己</p>
                        <span class="nonactivated" v-show="!VIPshow">VIP</span>
                        <span class="activated" v-show="VIPshow">VIP</span>
                    </div>
                </div>
            </div>
        </div>
        <!-- 权益 -->
        <div class="rightsAndInterests">
            <div class="memberContainer">
                <div class="RAI_title">
                    <!-- <p><span class="Mber">VIP会员权益</span><span class="RI">查看权益说明<span class="iconfont icon-youjiantou1"></span></span></p> -->
                    <p><span class="Mber">VIP会员权益</span></p>
                </div>
                <div class="RAI_content">
                    <div class="RDAD">
                        <span class="iconfont icon-quanchengbofangwuguanggaoquanchengbofangwuguanggao"></span>
                        <p>阅读无广告</p>
                    </div>
                    <div class="LSAD">
                        <span class="iconfont icon-tingshu"></span>
                        <p>听书无广告</p>
                    </div>
                    <div class="gold">
                        <span class="iconfont icon-jinbi"></span>
                        <p>额外金币</p>
                    </div>
                    <div class="accelerate">
                        <span class="iconfont icon-jiasu"></span>
                        <p>等级加速</p>
                    </div>
                </div>
            </div>
        </div>
        <!-- 开通时间 -->
        <div class="OpeningTime">
            <div class="memberContainer">
                <ul class="OT_Box">
                    <li :class="{'con':priceShow==0}" @click="priceShow=0">
                        <span class="days">
                            <span class="days_tiem">7天</span>
                        </span>
                        <span class="price">
                            <span class="originalCost">¥6</span>
                            <span class="currentPrice">¥4.9</span>
                        </span>
                    </li>
                    <li :class="{'con':priceShow==1}" @click="priceShow=1">
                        <span class="days">
                            <span class="days_tiem">1个月</span>
                            <span class="hot">最热</span>
                        </span>
                        <span class="price">
                            <span class="originalCost">¥20</span>
                            <span class="currentPrice">¥15</span>
                        </span>
                    </li>
                    <li :class="{'con':priceShow==2}" @click="priceShow=2">
                        <span class="days">
                            <span class="days_tiem">3个月</span>
                        </span>
                        <span class="price">
                            <span class="originalCost">¥60</span>
                            <span class="currentPrice">¥35</span>
                        </span>
                    </li>
                    <li :class="{'con':priceShow==3}" @click="priceShow=3">
                        <span class="days">
                            <span class="days_tiem">12个月</span>
                            <span class="cost">仅10.7元/月</span>
                        </span>
                        <span class="price">
                            <span class="originalCost">¥240</span>
                            <span class="currentPrice">¥129</span>
                        </span>
                    </li>
                </ul>
            </div>
        </div>
        <!-- 支付方式 -->
        <div class="pay">
            <div class="memberContainer">
                <ul>
                    <li>
                        <div class="li_left">
                            <span class="iconfont icon-weixinzhifuxuanzhong wx"></span>
                            <span class="pay_text">微信支付</span>
                        </div>
                        <div class="li_right" @click="wx_choice">
                            <span class="iconfont icon-duigou-weigouxuan wxz" v-show="!wx_payShow"></span>
                            <span class="iconfont icon-check_bg_black yxz" v-show="wx_payShow"></span>
                        </div>
                    </li>
                    <li>
                        <div class="li_left">
                            <span class="iconfont icon-zhifu-_zhifubaozhifu zfb"></span>
                            <span class="pay_text">支付宝</span>
                        </div>
                        <div class="li_right" @click="zfb_choice">
                            <span class="iconfont icon-duigou-weigouxuan wxz" v-show="!zfb_payShow"></span>
                            <span class="iconfont icon-check_bg_black yxz" v-show="zfb_payShow"></span>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <!-- 提示 -->
        <div class="pay_tips">
            <div class="memberContainer">
                <p class="tips_title">温馨提示</p>
                <p>1.若开通VIP会员后10分钟内标识仍然没有点亮，请退出账号后重新登录进行尝试，或联系客服QQ:3598987377。</p>
                <p>2.开通VIP会员则默认您已同意七猫免费小说<span>《用户协议》</span>、<span>《隐私协议》</span>、<span>《VIP会员服务协议》</span>。</p>
                <p>3.VIP会员时长中，一个月=31天。</p>
                <p>如有其他疑问，<span>请前往帮助与反馈>></span></p>
            </div>
        </div>
        <!-- 订单操作 -->
        <div class="orderForm">
            <div class="total">总计 <span>¥{{totalPrices}}</span></div>
            <div class="notarizeBtn" @click="openBtn">
                <span>立即开通</span>
            </div>
        </div>
    </div>
</template>

<script>
import Vue from 'vue';
import { Toast,Dialog } from 'vant';

Vue.use(Dialog);
export default {
    data(){
        return{
            wx_payShow:true,
            zfb_payShow:false,
            priceShow:1,
            VIPshow:false,
        }
    },
    methods:{
        wx_choice(){
            this.wx_payShow = true
            this.zfb_payShow = false
        },
        zfb_choice(){
            this.wx_payShow = false
            this.zfb_payShow = true
        },
        // 开通按钮
        openBtn(){
            Dialog.confirm({
            title: '七猫VIP会员',
            message: '是否开通?',
            }).then(() => {
                // on confirm
                Toast("支付成功");
                this.VIPshow = true
            }).catch(() => {
                // on cancel
                Toast("操作取消");
            });
        }
    },
    computed:{
        totalPrices:function(){
            return this.priceShow == 0 ? 4.9 : this.priceShow == 1? 15 : this.priceShow == 2 ? 35 :this.priceShow == 3 ? 129 : 0;
        }
    },
    created(){
    }
}
</script>

<style lang="less">
.memberContainer{
  width: 92%;
  margin: 0px auto;
}
.memberTop{
    text-align: center;
    padding: 13px 0px;
    background-color: #fff;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    z-index: 10;
    box-shadow: 0px 0px 3px #eee;
    .memberContainer{
        position: relative;
        font-weight: bold;
        span{
            position: absolute;
            top: 0px;
            left: 0px;
            font-size: 24px;
        }
        p{
            font-size: 18px;
        }
    }
}
.memberInfo{
    padding-top: 60px;
    background-color: #fff;
    position: relative;
    z-index: 5;
    .MI_Img{
        width: 100%;
        // height: 150px;
        overflow: hidden;
        border-radius: 10px;
        img{
            width: 100%;
            // height: 100%;
        }
    }
    .MI_Text{
        position: absolute;
        top: 60px;
        left: 20px;
        padding: 14px 10px;
        h2{
            font-size: 20px;
            color: #aaa;
        }
        h2.text_activated{
            color: #fbbf0f;
        }
        .MITname{
            display: flex;
            align-items: center;
            margin-top: 30px;
            .MIT_Img{
                width: 30px;
                height: 30px;
                overflow: hidden;
                border-radius: 50%;
                img{
                    width: 100%;
                    height: 100%;
                }
            }
            p{
                color: #aaa;
                margin-left: 10px;
            }
            p.name_activated{
                color: #fbbf0f;
            }
            span{
                font-size: 12px;
                background-color: #c5c5c3;
                color: white;
                padding: 1px 4px;
                border-radius: 4px;
                margin-left: 5px;
            }
            span.activated{
                background-color: #fbbf0f;
            }
        }
    }
}
.rightsAndInterests{
    background-color: #fff;
    padding-top: 10px;
    .RAI_title{
        font-size: 17px;
        padding: 10px 0px;
        p{
            display: flex;
            justify-content: space-between;
            align-items: center;
            .Mber{
                font-weight: bold;
            }
            .RI{
                font-size: 14px;
                color: #aaa;
                span{
                    font-size: 14px;
                }
            }
        }
    }
    .RAI_content{
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: center;
        margin-top: 10px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        .RDAD{
            span{
                font-size:30px;
                background-color: #fff7de;
                padding: 7px;
                border-radius: 50%;
                color: #fbbf0f;
            }
            p{
                font-size: 13px;
                margin-top: 10px;
            }
        }
        .LSAD{
            span{
                font-size:28px;
                background-color: #fff7de;
                padding: 8px;
                border-radius: 50%;
                color: #fbbf0f;
            }
            p{
                font-size: 13px;
                margin-top: 10px;
            }
        }
        .gold{
            span{
                font-size:30px;
                background-color: #fff7de;
                padding: 7px;
                border-radius: 50%;
                color: #fbbf0f;
            }
            p{
                font-size: 13px;
                margin-top: 10px;
            }
        }
        .accelerate{
            span{
                font-size:28px;
                background-color: #fff7de;
                padding: 8px;
                border-radius: 50%;
                color: #fbbf0f;
            }
            p{
                font-size: 13px;
                margin-top: 10px;
            }
        }
    }
}
.OpeningTime{
    background-color: #fff;
    padding: 20px 0px;
    margin-bottom: 10px;
    .memberContainer{
        ul.OT_Box{
            border: 1px solid #aaa;
            border-radius: 10px;
            li{
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 15px;
                border-radius: 10px;
                .days{
                    .days_tiem{
                        margin-right: 20px;
                    }
                    .hot{
                        color: #fe4341;
                        font-size: 13px;
                        border: 1px solid #fe4341;
                        padding: 1px 5px;
                        border-radius: 4px;
                    }
                    .cost{
                        color: #fe4341;
                        font-size: 13px;
                    }
                }
                .price{
                    .originalCost{
                        color: #aaa;
                        font-size: 14px;
                        text-decoration: line-through;
                        margin-right: 10px;
                    }
                    .currentPrice{
                        font-size: 18px;
                        color: #f7c80c;
                    }
                }
            }
            li.con{
                border: 2px solid #f7c80c;
                box-sizing: border-box;
                padding: 13px;
            }
        }
    }
}
.pay{
    background-color: #fff;
    margin-bottom: 10px;
    ul{
        li{
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0px;
            .li_left{
                display: flex;
                align-items: center;
                span{
                    font-size: 28px;
                    padding-right: 5px;
                }
                span.wx{
                    color: #46d13b;
                }
                span.zfb{
                    color: #02a9f1;
                }
                .pay_text{
                    font-size: 16px;
                    color: #333;
                    font-weight: bold;
                }
            }
            .li_right{
                display: flex;
                align-items: center;
                .wxz{
                    font-size: 30px;
                    color: #aaa;
                }
                .yxz{
                    font-size: 20px;
                    color: #fcc900;
                    border-radius: 50%;
                    padding: 5px;
                    overflow: hidden;
                }
            }
        }
    }
}
.pay_tips{
    background-color: #fff;
    padding: 15px 0px;
    padding-bottom: 50px;
    p{
        font-size: 14px;
        color: #aaa;
        line-height: 24px;
        margin-bottom: 6px;
        span{
            color: #f2ad32;
        }
    }
}
.orderForm{
    position: fixed;
    left: 0px;
    bottom: 0px;
    width: 100%;
    box-shadow: 0px -2px 5px #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    height: 50px;
    background-color: #fff;
    .total{
        width: 30%;
        span{
            color: #fdd525;
        }
    }
    .notarizeBtn{
        width: 50%;
        background-color: #fed21b;
        line-height: 50px;
    }
}
</style>